﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace MessageQuque
{
    class ProgramExecutor
    {
        static void Main(string[] args)
        {
            try
            {
                ServerExecutor.Start();

                Console.Write("服务已经启动，输入Q可以退出服务，服务开启动时间：{0}", DateTime.Now.ToString());
                while (true)
                {
                    var cmd = Console.ReadKey();
                    if (cmd.Key == ConsoleKey.Q)
                        break;
                }
            }
            catch (Exception e)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("服务启动失败：\r\n\r\n{0}", e.ToString());
                Console.ReadLine();
            }
        }
    }
}
